const theme = {
  state: {
    themeStyle: {
      '--global-color-100': 'rgb(26, 115, 232)', // 主色
      '--global-color-200': 'rgb(138, 180, 248)', // 辅色
      '--global-color-300': 'rgb(210, 227, 252)', // 选项选中背景主色
      '--global-color-400': 'rgb(239, 244, 252)', // 蒙层
      '--global-color-500': 'rgb(0, 0, 0)' // 文字主色
    }
  },
  mutations: {
    setThemeStyle(state, themeStyle) { // 设置主题风格
      if (themeStyle) { state.themeStyle = themeStyle }
    }
  },
  actions: {},
  getters: {
    getThemeStyle: (state) => state.themeStyle,
    getThemeStyleVar: (state) => { // 处理css变量
      const themeStyle = state.themeStyle
      let themeStyleVar = ''
      for (const key in themeStyle) {
        themeStyleVar += `${key}: ${themeStyle[key]};`
      }
      return themeStyleVar
    }
  }
}

export default theme

